package us.codecraft.webmagic.model;

import java.util.List;

import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.model.annotation.ExtractBy;
import us.codecraft.webmagic.model.annotation.TargetUrl;
import us.codecraft.webmagic.selector.Type;

@TargetUrl("http://api.mayiyiyi.com/v1/app/getdetail*")
@ExtractBy(value = "router('def process(obj){\nreturn us.codecraft.webmagic.model.AntStore.decrypt(obj);\n}')", source = Source.RawText)
public class AntDetail implements AfterExtractor {

    @ExtractBy(value = "$.data.list[0].items[0].id", type = Type.json)
    private String id;
    @ExtractBy(value = "$.data.list[0].items[0].icon", type = Type.json)
    private String icon;
    @ExtractBy(value = "$.data.list[0].items[0].bg", type = Type.json)
    private String bg;
    @ExtractBy(value = "$.data.list[0].items[0].title", type = Type.json)
    private String title;
    @ExtractBy(value = "$.data.list[0].items[0].subtitle", type = Type.json)
    private String subtitle;
    @ExtractBy(value = "$.data.list[0].items[0].packname", type = Type.json)
    private String packname;
    @ExtractBy(value = "$.data.list[0].items[0].downnum", type = Type.json)
    private String downnum;
    @ExtractBy(value = "$.data.list[0].items[0].tag[*]", type = Type.json, multi = true)
    private List<String> tag;
    @ExtractBy(value = "$.data.list[0].items[0].size", type = Type.json)
    private String size;
    @ExtractBy(value = "$.data.list[0].items[0].code", type = Type.json)
    private String code;
    @ExtractBy(value = "$.data.list[0].items[0].version", type = Type.json)
    private String version;
    @ExtractBy(value = "$.data.list[0].items[0].uptime", type = Type.json)
    private String uptime;
    @ExtractBy(value = "$.data.list[0].items[0].desc", type = Type.json)
    private String desc;
    @ExtractBy(value = "$.data.list[0].items[0].score", type = Type.json)
    private String score;
    @ExtractBy(value = "$.data.list[0].items[0].downurl", type = Type.json)
    private String downurl;
    @ExtractBy(value = "$.data.list[0].items[0].reurl", type = Type.json)
    private String reurl;
    @ExtractBy(value = "$.data.list[0].items[0].reurl2", type = Type.json)
    private String reurl2;
    @ExtractBy(value = "$.data.list[0].items[0].contentLength", type = Type.json)
    private String contentLength;
    @ExtractBy(value = "$.data.list[0].items[0].md5v", type = Type.json)
    private String md5v;
    @ExtractBy(value = "$.data.list[2].items[*].bigRecPic", type = Type.json, multi = true)
    private List<String> bigRecPic;
    private String menuName;
    private String menuId;
    private String menuPic;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getContentLength() {
        return contentLength;
    }

    public void setContentLength(String contentLength) {
        this.contentLength = contentLength;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getBg() {
        return bg;
    }

    public void setBg(String bg) {
        this.bg = bg;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public String getPackname() {
        return packname;
    }

    public void setPackname(String packname) {
        this.packname = packname;
    }

    public String getDownnum() {
        return downnum;
    }

    public void setDownnum(String downnum) {
        this.downnum = downnum;
    }

    public List<String> getTag() {
        return tag;
    }

    public void setTag(List<String> tag) {
        this.tag = tag;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getUptime() {
        return uptime;
    }

    public void setUptime(String uptime) {
        this.uptime = uptime;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public String getDownurl() {
        return downurl;
    }

    public void setDownurl(String downurl) {
        this.downurl = downurl;
    }

    public String getReurl() {
        return reurl;
    }

    public void setReurl(String reurl) {
        this.reurl = reurl;
    }

    public String getReurl2() {
        return reurl2;
    }

    public void setReurl2(String reurl2) {
        this.reurl2 = reurl2;
    }

    public String getMd5v() {
        return md5v;
    }

    public void setMd5v(String md5v) {
        this.md5v = md5v;
    }

    public List<String> getBigRecPic() {
        return bigRecPic;
    }

    public void setBigRecPic(List<String> bigRecPic) {
        this.bigRecPic = bigRecPic;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuPic() {
        return menuPic;
    }

    public void setMenuPic(String menuPic) {
        this.menuPic = menuPic;
    }

    @Override
    public void afterProcess(Page page) {
        this.menuId = (String) page.getRequest().getExtra("id");
        this.menuName = (String) page.getRequest().getExtra("name");
        this.menuPic = (String) page.getRequest().getExtra("pic");
    }
}
